<?php
/**
 * Map24Geocoder class file
 * 
 * @author    {author}
 * @copyright {copyright}
 * @package   {package}
 */

/**
 * RequestHeader.CustomerKeyValuePair class
 */
if ( !class_exists('RequestHeaderCustomerKeyValuePair') )
{
require_once 'RequestHeader.CustomerKeyValuePair.php5';
}
/**
 * ResponseHeader class
 */
if ( !class_exists('ResponseHeader') )
{
require_once 'ResponseHeader.php5';
}
/**
 * Configuration class
 */
if ( !class_exists('Configuration') )
{
require_once 'Configuration.php5';
}
/**
 * ConfigurationResponse class
 */
if ( !class_exists('ConfigurationResponse') )
{
require_once 'ConfigurationResponse.php5';
}
/**
 * RequestHeader class
 */
if ( !class_exists('RequestHeader') )
{
require_once 'RequestHeader.php5';
}
/**
 * ConfigurationRequest class
 */
if ( !class_exists('ConfigurationRequest') )
{
require_once 'ConfigurationRequest.php5';
}
/**
 * GeocodedAddress.Quality class
 */
if ( !class_exists('GeocodedAddressQuality') )
{
require_once 'GeocodedAddress.Quality.php5';
}
/**
 * Coordinate class
 */
if ( !class_exists('Coordinate') )
{
require_once 'Coordinate.php5';
}
/**
 * GeocodedAddress.Alternative class
 */
if ( !class_exists('GeocodedAddressAlternative') )
{
require_once 'GeocodedAddress.Alternative.php5';
}
/**
 * GeocodedAddress class
 */
if ( !class_exists('GeocodedAddress') )
{
require_once 'GeocodedAddress.php5';
}
/**
 * GeocodeAddressesResponse class
 */
if ( !class_exists('GeocodeAddressesResponse') )
{
require_once 'GeocodeAddressesResponse.php5';
}
/**
 * Address class
 */
if ( !class_exists('Address') )
{
require_once 'Address.php5';
}
/**
 * GeocodeAddressesRequest class
 */
if ( !class_exists('GeocodeAddressesRequest') )
{
require_once 'GeocodeAddressesRequest.php5';
}
/**
 * ReverseGeocodeAddressesRequest class
 */
if ( !class_exists('ReverseGeocodeAddressesRequest') )
{
require_once 'ReverseGeocodeAddressesRequest.php5';
}
/**
 * CoordinatesArray class
 */
if ( !class_exists('CoordinatesArray') )
{
require_once 'CoordinatesArray.php5';
}
/**
 * FindAddressesInsidePolygonRequest class
 */
if ( !class_exists('FindAddressesInsidePolygonRequest') )
{
require_once 'FindAddressesInsidePolygonRequest.php5';
}
/**
 * GeocodeResponse class
 */
if ( !class_exists('GeocodeResponse') )
{
require_once 'GeocodeResponse.php5';
}
/**
 * GeocodeRequest class
 */
if ( !class_exists('GeocodeRequest') )
{
require_once 'GeocodeRequest.php5';
}

/**
 * Map24Geocoder class
 * 
 *  
 * 
 * @author    {author}
 * @copyright {copyright}
 * @package   {package}
 */
class Map24Geocoder {

  private $client;

  private $wsdl = null;

  /**
   *
   * @param MapTP-System the request should be executed on $server
   * @param Map24Id $mid
   * @param Map24SessionId $sid
   */ 
  public function __construct($server=null, $mid=null, $sid=null, $interface='map24/webservices1.5') {
    if($server==null || $mid==null || $sid==null){
      echo "ERROR: Not enough or invalid arguments! Unable to initialise SoapClient.";
    }
    else {
      $this->wsdl = "http://".$server."/".$interface."?wsdl=Map24Geocoder";
      $this->client = new SoapClient($this->wsdl, array('location' => "http://".$server."/".$interface."?soap=Map24Geocoder&mid=".$mid."&sid=".$sid, 'trace' => 0, 'exceptions' => 1));
    }
  }

  /**
   *  
   *
   * @param RequestHeader $RequestHeader
   * @param ConfigurationRequest $ConfigurationRequest
   * @return ConfigurationResponse
   */
  public function getConfiguration(RequestHeader $RequestHeader, ConfigurationRequest $ConfigurationRequest) {
    return $this->client->getConfiguration($RequestHeader, $ConfigurationRequest);
  }

  /**
   *  
   *
   * @param RequestHeader $RequestHeader
   * @param GeocodeAddressesRequest $GeocodeAddressesRequest
   * @return GeocodeAddressesResponse
   */
  public function geocodeAddresses(RequestHeader $RequestHeader, GeocodeAddressesRequest $GeocodeAddressesRequest) {
    return $this->client->geocodeAddresses($RequestHeader, $GeocodeAddressesRequest);
  }

  /**
   *  
   *
   * @param RequestHeader $RequestHeader
   * @param ReverseGeocodeAddressesRequest $ReverseGeocodeAddressesRequest
   * @return GeocodeAddressesResponse
   */
  public function reverseGeocodeAddresses(RequestHeader $RequestHeader, ReverseGeocodeAddressesRequest $ReverseGeocodeAddressesRequest) {
    return $this->client->reverseGeocodeAddresses($RequestHeader, $ReverseGeocodeAddressesRequest);
  }

  /**
   *  
   *
   * @param RequestHeader $RequestHeader
   * @param FindAddressesInsidePolygonRequest $FindAddressesInsidePolygonRequest
   * @return GeocodeAddressesResponse
   */
  public function findAddressesInsidePolygon(RequestHeader $RequestHeader, FindAddressesInsidePolygonRequest $FindAddressesInsidePolygonRequest) {
    return $this->client->findAddressesInsidePolygon($RequestHeader, $FindAddressesInsidePolygonRequest);
  }

  /**
   *  
   *
   * @param RequestHeader $RequestHeader
   * @param GeocodeRequest $GeocodeRequest
   * @return GeocodeResponse
   */
  public function geocode(RequestHeader $RequestHeader, GeocodeRequest $GeocodeRequest) {
    return $this->client->geocode($RequestHeader, $GeocodeRequest);
  }

}

?>
